Change the links and text to be displayed in the menu by editing the lines containing the <code>OPTION</code> tags. Note that you can also use full URL's in the VALUE attribute.</p>
<p>
Change the text of the button in the Value attribute of <br>
<p>The actual JavaScript is in the button's onClick handler. The JavaScript array <code>this.form.menu.options</code> is an array of the option tags (with its contents) in the form named "menu". To find which menu item that is selected we can use the property <code>this.form.menu.selectedIndex</code>, that holds the index of the selected item.</p>
<p>
We then get the name of the page by accessing the value attribute of the selected item in the array with the expression <code>this.form.menu.options[this.form.menu.selectedIndex].value</code>.</p>
<p>
<code>top.location.href</code> is the address of the url to be displayed in the window. Since we set <code>top.location</code> to contain the new pages URL, the new page will be displayed in the entire window, even if our page is inside a frame. To get a page to be displayed in a specific frame is an exercise left to the reader <font size="-2" face="Monaco, Courier">;-)</font>. (You can also check out the Programming notes for the <a href="PopupMenu2">second JavaScript Popup Menu</a> to get a hint).</p>